Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Py2NRNString. #3249

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Refactor Py2NRNString. #3249

merged 2 commits into from
Dec 4, 2024

Conversation

1uc
Copy link
Collaborator

@1uc 1uc commented Nov 26, 2024

The Py2NRNString consisted of (what's now) a unique_cstr. The ctor would create the cstr, and {g,s}et_pyerr were non-static methods. They needed to check if the cstr as a nullptr, but where only ever called after checking that it was a nullptr.

This commit separates several notions:

  • Ownership is handled by unique_cstr.
  • An ASCII string is extracted from a Python object using as_ascii.
  • Both {g,s}et_pyerr were made static an are independent of each other and from converting a Python object to an (ASCII) C-string.
  • The PyErr2NRNString was removed.

Copy link

✔️ 9d6872b -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@1uc 1uc marked this pull request as ready for review November 26, 2024 11:36
@1uc 1uc force-pushed the 1uc/refactor-py2nrnstring branch from 9d6872b to c6523a2 Compare November 27, 2024 14:52
Copy link

✔️ c6523a2 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Base automatically changed from 1uc/unique_cstr to master November 27, 2024 20:55
@1uc 1uc force-pushed the 1uc/refactor-py2nrnstring branch from c6523a2 to fe213e8 Compare November 28, 2024 12:07
Copy link

codecov bot commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 87.87879% with 8 lines in your changes missing coverage. Please review.

Project coverage is 67.06%. Comparing base (d177f5b) to head (62ffda0).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/nrnpython/nrnpy_utils.cpp 83.33% 3 Missing ⚠️
src/nrnpython/inithoc.cpp 0.00% 2 Missing ⚠️
src/nrnpython/nrnpy_hoc.cpp 90.47% 2 Missing ⚠️
src/nrnpython/nrnpy_p2h.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3249      +/-   ##
==========================================
- Coverage   67.07%   67.06%   -0.01%     
==========================================
  Files         571      571              
  Lines      111110   111070      -40     
==========================================
- Hits        74528    74492      -36     
+ Misses      36582    36578       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

✔️ fe213e8 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@1uc 1uc force-pushed the 1uc/refactor-py2nrnstring branch from 8e5f96e to 62ffda0 Compare December 4, 2024 11:04
Copy link

sonarcloud bot commented Dec 4, 2024

Copy link

✔️ 62ffda0 -> Azure artifacts URL

@1uc 1uc merged commit 9e5dd3d into master Dec 4, 2024
36 checks passed
@1uc 1uc deleted the 1uc/refactor-py2nrnstring branch December 4, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants